package user_roles

import (
	"gitee.com/theegg/go-brick/app/model/partner/partner_admin/partner_admin_permissions"
	"time"
)

// 表名也是cache的tag
var TableName = "user_roles"

// @title UserRoles
// @description 用户角色
type UserRoles struct {
	Id   int64  `xorm:"pk autoincr"`
	Name string `xorm:"varchar(64) notnull 'name'"`
	Sign string `xorm:"varchar(64) notnull unique 'sign'"`
	Mark string `xorm:"varchar(128) null 'mark'"`

	AddAdminUserId int64  `xorm:"integer(11) notnull 'add_admin_user_id'"`
	AddAdminUserIp string `xorm:"char(15) notnull 'add_admin_user_ip'"`

	State     bool      `xorm:"BOOL notnull default(false) 'state'"`
	CreatedAt time.Time `xorm:"notnull created 'created_at'"`
	UpdatedAt time.Time `xorm:"null updated 'updated_at'"`

	// 不参与
	permissions map[int64]*partner_admin_permissions.PartnerAdminPermissions `xorm:"-"`
}
